package com.example.android_three.model

import android.os.Parcel
import android.os.Parcelable
import com.example.android_three.mvp.control.LreControl
import com.example.android_three.mvp.entity.BaseEntity
import com.example.android_three.wieget.Constant
import com.jess.arms.di.scope.ActivityScope
import com.jess.arms.integration.IRepositoryManager
import com.jess.arms.mvp.BaseModel
import io.reactivex.Observable
import io.reactivex.functions.Function
import io.reactivex.internal.functions.Functions
import javax.inject.Inject

@ActivityScope
class LreModel : BaseModel(  mRepositoryManager : IRepositoryManager), LreControl.LreControlModel, Parcelable {

    @Inject
    fun LreModel() {

    }


    override fun netWorkList(parm: String, constant: Constant): Observable<BaseEntity> {
        return selectObservable(constant)
    }

    override fun refreshList(parm: String, constant: Constant): Observable<BaseEntity> {
        return selectObservable( constant)
    }

    override fun loadingList(parm: String, constant: Constant): Observable<BaseEntity> {
        return selectObservable( constant)
    }


    private fun selectObservable(constant: Constant): Observable<BaseEntity> {

        var observable : Observable<BaseEntity>? = null

        when( constant) {

        }

        return Observable.fromArray( observable).flatMap( Functions.identity(), false, 1  )
    }



}